<template>
  <div id="lawHelp">
<!--    <service-item :title-text="title" :tab="tab"/>-->

    <el-container>
      <el-aside width="200px">
        <div class="title">
          <h2>法律求助</h2>
        </div>
        <div class="navButton">
          <el-menu
                  default-active='0'
                  class="el-menu-vertical-demo"
                  background-color="#2368ba"
                  text-color="#e7d9d9"
                  active-text-color="#ffd04b">
          </el-menu>
        </div>
      </el-aside>
      <el-main>
        <div class="title-wrapper"><div class="pro">求助内容</div></div>
        <div class="content">
          <el-form ref="form" :model="form2" label-width="200px">
            <el-form-item label="咨询标题：" required>
              <el-input v-model="form2.rec_title"
                        placeholder="请用小于20个字符总结一个求助标题"></el-input>
            </el-form-item>
            <el-form-item label="咨询内容:" required>
              <el-input type="textarea"
                        v-model="form2.rec_con"></el-input>
            </el-form-item>
            <el-button type="primary" @click="purchase">咨询</el-button>
          </el-form>
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
  import ServiceItem from "../../components/content/ServiceItem";
  export default {
    name: "LawHelp",
    components:{
      ServiceItem
    },
    data(){
      return{
        title:'法律求助',
        tab:[],
        form : {},
        form2 : {
          rec_title: '',
          rec_con : '',
          rec_price : '',
          ser_id : '',
          or_id : ''
        }
      }
    },
    methods:{
      purchase() {
        if (sessionStorage.getItem('isLogin') === '0') {
          this.$router.push('/login')
        } else if (sessionStorage.getItem('userType') == 'server') {
          alert('您当前登录身份为服务方，无法下单。如需下单请退出系统使用采买方身份登录！')
        } else {
          this.form.ber_id = this.$store.getters.getInfo.ber_id
          this.form.or_kind = 3
          this.form.or_product = this.form2.rec_title
          this.form.or_money = 50
          this.form.ser_id = ''
          this.form.or_pay = 0
          this.form.or_url = ''

          this.$router.push({
            name: 'Pay',
            params: {
              form: this.form,
              help : this.form2
            }
          })
        }
      }
    }
  }
</script>

<style scoped>
  .pro{
    background-color: #ffffff;
    width: 200px;
    height: 40px;
    border-top: 4px solid #0d6eb8;
    color: #0d6eb8;
    font-size: 18px;
    line-height: 40px;
  }
  .content{
    background-color: #ffffff;
    width: 100%;
    padding-top: 50px;
    display: flex;
    /*height: 600px;*/
  }

  /deep/.el-aside {
    /*background-color: #2368ba;*/
    color: #333;
    text-align: center;
    height: calc(100vh - 84px);
    /*line-height: 82px;*/
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    height: calc(100vh - 84px);
  }

  .title{
    width: 100%;
    height: 100px;
    line-height: 100px;
    border-bottom: 2px solid #0f4984;
    /*background-color: #225793;*/
    color: #2550a7;
  }
  .el-button{
    width: 150px;
    margin: 15px auto;
    font-size: 18px;
  }
  h2,h3{
    margin: 0;
  }
  .el-form{
    width: 800px;
  }
  /deep/.el-textarea__inner{
    min-height: 300px !important;
    font-size: 18px;
  }

  /deep/.el-form-item__label{
    font-size: 20px;
  }

  /deep/.el-input__inner{
    height: 60px;
    line-height: 60px;
    font-size: 18px;
  }
</style>